<?php
//$prize = ["冰箱", "电视", "手机", "洗衣机", "空调", "谢谢参与"];
$num = mt_rand(0,99);

    switch ($num) {
        case $num === 11:
            echo "恭喜你获得冰箱";
            break;
        case $num === 22:
            echo "恭喜你获得电视";
            break;
        case $num === 33:
            echo "恭喜你获得手机";
            break;
        case $num === 44:
            echo "恭喜你获得洗衣机";
            break;
        case $num === 55:
            echo "恭喜你获得空调";
            break;
        default:
            echo "谢谢惠顾！";

    }
//switch ($num){
//    case $prize[0]:
//        echo "恭喜你抽中冰箱";
//        break;
//    case $prize[1]:
//        echo "恭喜你抽中电视";
//        break;
//    case $prize[3]:
//        echo "恭喜你抽中手机";
//        break;
//    case $prize[4]:
//        echo "恭喜你抽中洗衣机";
//        break;
//    case $prize[5]:
//        echo "恭喜你抽中空调";
//        break;
//    default:
//        echo "谢谢惠顾";
//}

